/*
 * Copyright (c) 2025 EasyAdmin
 * All rights reserved.
 *
 * This file is part of the [EasAdmin] project.
 * Unauthorized copying of this file, via any medium, is strictly prohibited.
 * Proprietary and confidential.
 *
 * Author: EasyAdmin ( 1073602@qq.com )
 * Website: https://www.xhxiao.com
 */
package com.easy.module.log.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.easy.framework.database.entity.BaseEntity;
import com.easy.framework.poi.annotation.Excel;
import com.easy.framework.poi.annotation.Export;
import com.easy.framework.poi.annotation.Option;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * 操作日志 实体
 *
 * @author EasyAdmin ( 1073602@qq.com )
 * @date 2025-08-19
 */
@Getter
@Setter
@TableName(value = "sys_oper_log")
public class SysOperLog extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    @Excel(name = "编号")
    private Long id;

    /**
     * 模块
     */
    @Excel(name = "模块")
    private String module;

    /**
     * 类型
     */
    @Excel(name = "类型")
    private String type;

    /**
     * 描述
     */
    @Excel(name = "描述")
    private String description;

    /**
     * 请求方法
     */
    @Excel(name = "请求方法")
    private String method;

    /**
     * 请求URL
     */
    @Excel(name = "请求URL")
    private String url;

    /**
     * 请求IP
     */
    @Excel(name = "请求IP")
    private String ip;

    /**
     * 请求地点
     */
    @Excel(name = "请求地点")
    private String location;

    /**
     * 请求参数
     */
    @Excel(name = "荷载参数")
    private String payload;

    /**
     * 响应结果
     */
    @Excel(name = "响应结果")
    private String result;

    /**
     * 设备
     */
    @Excel(name = "设备")
    private String device;

    /**
     * 系统
     */
    @Excel(name = "系统")
    private String os;

    /**
     * 浏览器
     */
    @Excel(name = "浏览器")
    private String browser;

    /**
     * 状态（0正常 1异常）
     */
    @Excel(
            name = "状态",
            options = {
                    @Option(value = "0", name = "正常"),
                    @Option(value = "1", name = "异常")
            }
    )
    private Integer status;

    /**
     * 错误
     */
    @Excel(name = "错误")
    private String error;

    /**
     * 耗时（毫秒）
     */
    @Excel(name = "耗时（毫秒）")
    private Long time;

    /**
     * 操作用户名
     */
    @Excel(name = "操作用户名")
    private String username;


    /**
     * 操作用户编号
     */
    @Excel(name = "操作用户编号")
    private Long userId;

    /**
     * 操作时间
     */
    @Excel(name = "操作时间", export = @Export(format = "yyyy-MM-dd HH:mm:ss"))
    private Date operAt;
}
